package com.mycinema.biz.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.mycinema.biz.CategoryBiz;
import com.mycinema.dao.CategoryDao;
import com.mycinema.entity.Category;
@Service("categoryBiz")
public class CategoryBizImpl implements CategoryBiz{

	@Autowired
	private CategoryDao categoryDao;	
	
	@Transactional(propagation=Propagation.REQUIRED)
	public List<Category> getAll() {
		
		return categoryDao.getAll();
	}

	public Category getById(int id) {
		
		return categoryDao.getById(id);
	}

	public void insertCategory(Category category) {
		
		categoryDao.insertCategory(category);
	}

	public void updateCategory(Category category) {
		categoryDao.updateCategory(category);		
	}
	public List<Category> getWithList() {
	
		return categoryDao.getWithList();
	}

	public List<Category> getCategoryMovies() {
		
		return categoryDao.getCategoryMovies();
	}
	public void delete(int id) {
		
		//categoryDao.delete(id);
		categoryDao.delete(8);
		categoryDao.delete(1);
		
	}

}
